<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/5/25
 * Time: 14:36
 */

namespace app\controller;


use app\model\Banner as BannerModel;
use app\model\Example as ExampleModel;
use app\model\Post as PostModel;
use app\model\Buju as BujuModel;
use app\model\Contact as ContactModel;

class Index extends Base
{
    public function index()
    {
        $act = 1;
        $i = 'home';
        $banners = BannerModel::getBanner();
        $examples = ExampleModel::getThree();
        $posts = PostModel::getItems();
        $buju = BujuModel::getAll();
        return view('index', compact(['act', 'i', 'banners', 'examples', 'posts', 'buju']));
    }

    public function contact()
    {
        $act = 7;
        $i = 'contact';
        $contact = ContactModel::get(1);
        return view('contact', compact(['act', 'i', 'contact']));
    }
}